class Admin::FeedbacksController < Admin
  def index
    @feedbacks = Feedback.find(:all, :order => 'created_at DESC')
  end
  
  def show
    @feedback = Feedback.find(params[:id])
    @feedback.read = true
    @feedback.save!
  end
  
  def delete
    unless params["delete_list"].nil?
      params["delete_list"].each do |feedback_id, deleted|
        begin
          if(deleted == "1")
            Feedback.find(feedback_id).destroy
          end
        rescue
        end
      end
    end
    redirect_to :action => :index
  end
end